//
//  CYDefaultRecordAO.m
//  CreditAddressBook
//
//  Created by Lee on 15/5/12.
//  Copyright (c) 2015年 Lee. All rights reserved.
//

#import "CYDefaultRecordAO.h"
#import "MJExtension.h"

@implementation CYDefaultRecordAO

MJCodingImplementation

+ (NSArray *)ignoredPropertyNames {
    return @[@"iconImage"];
}

+ (NSArray *)ignoredCodingPropertyNames {
    return @[@"iconImage"];
}



- (NSString *)typeName {

     if (self.type) {
          if (self.type.intValue == 2 || self.type.intValue == 5) {
               return @"个人录入";
          }
          if (self.type.intValue == 1) {
               return @"黑名单用户";
          }
          if (self.type.intValue == 0 || self.type.intValue == 4) {
               return @"企业提供";
          }else {
               return @"法院公示";
               
          }
     }else if(!self.type){
          return @"法院公示";
          
     }
     
     
    switch (self.type && self.type.longLongValue) {
        case 0:
            return @"企业录入";
            break;
            
        case 1:
            return @"黑名单用户";
            break;
            
        case 2:
            return @"个人用户";
            break;
            
        case 3:
            return @"法院公示";
            break;
            
        case 4:
            return @"企业提供";
            break;
            
        case 5:
            return @"个人提供";
            break;
            
        default:
            return @"法院公示";
            break;
    }
}

- (UIImage *)iconImage {
    if (self.iconTag == 1) {
        return [UIImage imageNamed:@"icon_yellow"];
    }else if (self.iconTag == 0) {
        return [UIImage imageNamed:@"icon_orange"];
    }else {
        return [UIImage imageNamed:@"icon_red"];
    }
}

- (NSString *)sexName {
    if (!self.sex || self.sex.isEmpty) return @"--";
    return [self.sex equals:@"1"] ? @"女" : @"男";
}
@end
